/***********************************************************************
** Copyright (C) 2011 Anthony Naddeo <anthony.naddeo@gmail.com>
**
** This file is part of LinkedUp
**
** LinkedUp is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 3 of the License, or
** (at your option) any later version.
**
** LinkedUp is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this package; If not, see <http://www.gnu.org/licenses/>.
**
***********************************************************************/
import QtQuick 1.1
import com.meego 1.0
import "../components"

Item{
	id: root
	width: parent.width
	height: rootColumn.height+30

	Component.onCompleted: ListView.view.height = height

	//	property bool following: User.following(id) ? true : false

//	signal follow(string id)
//	signal stopFollow(string id)
//	signal finance(string tickerSymbol)
//	signal news(string companyName)

	Component{
		id: section
		Section{}
	}

	Column{
		id: rootColumn
		width: root.width
		spacing: 20

		Component.onCompleted: {
			if(industry)
				var indSec = section.createObject(rootColumn, {"titleText":"Industry", "contentText":industry})
			if(description)
				var aboutSec = section.createObject(rootColumn, {"titleText":"About", "contentText":description})
		}

		Image {
			id: image
			height: 100
			width: 200
			fillMode: Image.PreserveAspectFit
			source: logoUrl || "qrc:///qml/images/profile-picture.png"
			smooth: true
			anchors.horizontalCenter: parent.horizontalCenter
		}

		Section{
			width: parent.width
			titleText: "Site"
			contentText: '<a href="'+websiteUrl+'">'+websiteUrl+'</a>'
			onLinkActivated: Qt.openUrlExternally(link)
		}



		//			Row{//two rows for buttons becuase the follow button grows large
		//				id: buttonRow
		//				Button{
		//					id: financeButton
		//					enabled: ticker ? true : false
		//					iconSource: "qrc:///qml/images/stock-small.png"
		//					onClicked: root.finance(ticker)
		//				}
		//				Button{
		//					id: newsButton
		//					iconSource: "qrc:///qml/images/news-small.png"
		//					onClicked: root.news(name)
		//				}
		//			}

		//			Row{
		//				Button{
		//					id: follow
		//					text: following ? "Following " + name : "Follow " + name
		//					//				   onClicked: following ? root.stopFollow(id) : root.follow(id) //mm uncomment this when xmlhttp delete is implemented
		//					onClicked: root.follow(id)
		//					iconSource: following ? "qrc:///qml/images/star-on.png" : "qrc:///qml/images/star-off.png"
		//					//				   Behavior on text { NumberAnimation{ duration: 250}}
		//				}
		//			}

	}




}
